<?php
my_component_load('testing' , false);
my_component_load('paging' , false);  
my_component_load('pemberhentian' );
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$sk_id = isset( $_GET['sk_id'] ) ? $_GET['sk_id']:  0;

$jid = isset( $_GET['jid'] ) ? $_GET['jid']:  0;
$sid = isset( $_GET['sid'] ) ? $_GET['sid']:  0;
$modulname = "Personalia _BN_ Penempatan _BN_ Pemutusan Hubungan Kerja";
if($_SERVER['REQUEST_METHOD'] == "POST" ):	
	switch($task){ 
		case "edit":
			submit_sk($id) ;
			my_direct('index.php?com=pemberhentian');
			break;
		case "edit_karyawan":
			submit_karyawan($sk_id,$id) ;
			my_direct('index.php?com=pemberhentian&task=detail&sk_id='.$sk_id);
			break;	
		case "list_mpp":
			stor_karyawan_pensiun($sk_id);
			my_direct('index.php?com=pemberhentian&task=detail&sk_id='.$sk_id);
			break;		
	}
else: 	
	if($task == "detail"){ 
		$pagename = $modulname." _BN_ Detail";
		load_facebox_script();
		$content =  list_karyawan($sk_id); 
	}elseif($task == "edit_karyawan"){ 
		$pagename = ($id > 0 ) ? $modulname." _BN_ Perubahan Data" : $modulname." _BN_ Tambah Data";
		$content =$content = form_edit_karyawan($sk_id,$id) ;
	}elseif($task == "delete_karyawan"){
		delete_karyawan($sk_id,$id);
		my_direct('index.php?com=pemberhentian&task=detail&sk_id='.$sk_id);
		exit;

	}elseif($task == "list_mpp"){ 
		$pagename = $modulname." _BN_ Detail";
		load_facebox_script();
		$content =  list_mpp($sk_id); 		
		
	}elseif($task == "edit"){ 
		$pagename = ($id > 0 ) ? $modulname." _BN_ Perubahan Data" : $modulname." _BN_ Tambah Data";
		$content =$content = form_sk($id);;
	}elseif($task == "delete"){
		delete_sk($id);
		my_direct('index.php?com=pemberhentian');
		exit;
	}else{ 
		$pagename = $modulname;
		load_facebox_script();
		$content =  list_sk(); 		
	}
endif;  
generate_my_web($content, $pagename );
?>